<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@page import="com.xypw.models.News"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>项目信息公开</title>
<link href="<%=request.getContextPath()%>/css/css.css" rel="stylesheet"
	type="text/css" />
<link href="<%=request.getContextPath()%>/css/xheditor/xheditor.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="<%=request.getContextPath()%>/scripts/jquery.pack.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/scripts/xheditor.js"></script>
<script type="text/javascript" 
	src="<c:url value='/scripts/datePicker/WdatePicker.js'/>"></script>
<script type="text/javascript">
	function check(f){
		var checkText=$("#statusFlag").find("option:selected").text();
		if(f.title.value == ""){
			alert("请填写标题");
			return false;
		}
		if(f.publishDate.value == ""){
			alert("请选择发布日期");
			return false;
		}
		if(f.type.value == -1){
			alert("请选择类型");
			return false;
		}
		if( !confirm('新闻的状态将保存为 "'+checkText+'",确定要修改吗？ ')){
			return false;
		}
		return true;
	}
	function init(){
		${initInfo};
	}
	function dele(id){
		location.href="<%=request.getContextPath()%>/news/deleteNews/"+id
	}
</script>
</head>
<body onload="init();">

<!--公共 头部-->
<c:import url="/views/common/staticBannerWithoutJumper.jsp" />

<table border="0" align="center" cellpadding="0" cellspacing="0">
	<tbody>
		<tr>
			<td><img src="<%=request.getContextPath()%>/images/none.gif"
				width="1004" height="6" /></td>
		</tr>
	</tbody>
</table>
<form method="post" action="<%=request.getContextPath()%>/news/auditNews/${newsInfo.id}" onsubmit="return check(this);">
<table width="1000" height="600px;auto;" border="0" align="center"
	cellpadding="0" cellspacing="0">
	<tr align="center" valign="top">
		<td bgcolor="#FFFFFF">
		<table width="1000" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<tbody>
				<tr>
					<td width="15" height="31"><img
						src="<%=request.getContextPath()%>/images/wsgaj-1_11.jpg"
						width="15" height="31" alt="" /></td>
					<td width="975"
						background="<%=request.getContextPath()%>/images/wsgaj-1_12.jpg">
					<table width="975" border="0" align="center" cellpadding="0"
						cellspacing="0">
						<tbody>
							<tr>
								<td class="q4" align="left">当前位置：首页 &gt;&gt; 新闻中心&gt;&gt;
								新闻撰写</td>
							</tr>
						</tbody>
					</table>
					</td>
					<td width="10">
						<img src="<%=request.getContextPath()%>/images/wsgaj-1_14.jpg" width="10" height="31" alt="" />
					</td>
				</tr>
			</tbody>
		</table>

		<div align="center" style="width: 1000px">
		<table class="tdata" >
			<tbody>
				<tr>
					<td width="10%" align="right" >主标题</td>
					<td width="90%" align="left" colspan="3">
						<input type="text" name="title" size="100" value="${newsInfo.title}"/>
					</td>
				</tr>
				<tr>
					<td align="right">副标题</td>
					<td align="left" colspan="3">
						<input type="text" name="subTitle" size="100" value="${newsInfo.subTitle}"/>
					</td>
				</tr>
				<tr>
					<td align="right">来源</td>
					<td align="left" colspan="3">
						<input type="text" name="comeSource" size="100" value="${newsInfo.comeSource}"/>
					</td>
				</tr>
				<tr>
					<td align="right" width="10%">发布日期</td>
					<td align="left" width="25%">
						<input type="text" name="publishDate" size="20" onclick="WdatePicker()" readonly="readonly" value="${newsInfo.publishDate}"/>
					</td>
					<td align="right" width="15%">类型</td>
					<td align="left" width="40%">
						<select name="newsType">
							<option value="-1"></option>
							<%String[] _typeArry = com.xypw.models.News.TYPE_ARRY;%>
							<%int _type = -1;%>
							<%	News _newsInfo = (News)request.getAttribute("newsInfo"); %>
							<%	if(_newsInfo != null){ _type = _newsInfo.getNewsType();} %>
							<%for(int i = _typeArry.length-1; i >= 0; i-- ){ %>
							<%	if( i != _type){ %>
							<%		out.print("<option value=\""+i+"\">"+_typeArry[i]+"</option>"); %>
							<%	}else{ %>
							<%		out.print("<option selected=\"selected\" value=\""+i+"\">"+_typeArry[i]+"</option>"); %>
							<%	} %>
							<%} %>
						</select>
					</td>
				</tr>
				<tr>
					<td align="right" width="10%">当前状态</td>
					<td align="left" width="25%">
							<%String[] _statusArry = com.xypw.models.News.STATUS_ARRY;%>
							<%int _status = -1;%>
							<%if(_newsInfo != null){ _status = _newsInfo.getStatusFlag();} %>
							<%=_statusArry[_status]%>
					</td>
					<td align="right" width="15%">操作</td>
					<td align="left" width="40%">
						<select name="statusFlag" id="statusFlag">
							<%	if(_newsInfo != null){ _type = _newsInfo.getStatusFlag();} %>
							<%	for(int i = _statusArry.length-1; i >= 0; i-- ){ %>
							<%	if( i != _status){ %>
							<%			out.print("<option value=\""+i+"\">"+_statusArry[i]+"</option>"); %>
							<%		}else{ %>
							<%			out.print("<option selected=\"selected\" value=\""+i+"\">"+_statusArry[i]+"</option>"); %>
							<%		} %>
							<%	} %>
						</select>
					</td>
				</tr>
			</tbody>
		</table>
			<div><textarea id="elm2" name="content"
				class="xheditor-mini {width:'1000',height:'700',hoverExecDelay:-1,layerShadow:0,disableContextmenu:true,html5Upload:false,upMultiple:5,upImgUrl:'<%=request.getContextPath()%>/fileUploadSevlet/imgUpload/',upImgExt:'jpg,jpeg,gif,png'}">${newsInfo.content}</textarea>
			</div>
		<input name="id" type="hidden" value="${newsInfo.id}" />
		<input type="submit" value="提  交" />
		<input type="button" value="删  除" onclick="dele(${newsInfo.id})"></input>
		</div>
		</td>
	</tr>
</table>
</form>
<!--公共 尾部版权-->
<c:import url="/views/common/staticFoot.jsp" />
</body>
</html>
